@model OrchardCore.ContentFields.Settings.NumericFieldSettings
@using System.Globalization

@{
    var step = Math.Pow(10, 0 - Model.Scale);
    var stepAttribute = step.ToString(CultureInfo.InvariantCulture);
    string minimum = (Model.Minimum.HasValue) ? Math.Round(Model.Minimum.Value, Model.Scale).ToString(CultureInfo.InvariantCulture) : "";
    string maximum = (Model.Maximum.HasValue) ? Math.Round(Model.Maximum.Value, Model.Scale).ToString(CultureInfo.InvariantCulture) : "";
}

<div class="form-group">
    <div class="custom-control custom-checkbox">
        <input asp-for="Required" type="checkbox" class="custom-control-input">
        <label class="custom-control-label" asp-for="Required">@T["Required"]</label>
        <span class="hint">— @T["Whether a value is required."]</span>
    </div>
</div>

<div class="form-group">
    <div class="row col-md">
        <label asp-for="Hint">@T["Hint"]</label>
        <textarea asp-for="Hint" rows="2" class="form-control"></textarea>
        <span class="hint">@T["The hint text to display for this field on the editor."]</span>
    </div>
</div>

<div class="form-group">
    <div class="row col-md">
        <label for="Placeholder">@T["Watermark (placeholder)"]</label>
        <input asp-for="Placeholder" type="text" class="form-control" />
        <span class="hint">@T["A hint to display when the input is empty. (optional)"]</span>
    </div>
</div>

<div class="form-group">
    <div class="row col-sm">
        <label for="Scale">@T["Scale"]</label>
        <input asp-for="Scale" class="form-control" min="0" max="5" step="1" type="number" />
        <span class="hint">@T["The number of digits after the decimal point."]</span>
    </div>
</div>

<div class="form-group">
    <div class="row col-sm">
        <label for="Minimum">@T["Minimum"]</label>
        <input asp-for="Minimum" class="form-control" />@*step="@step" type="number"*@
        <span class="hint">@T["The minimum value allowed. (optional)"]</span>
    </div>
</div>

<div class="form-group">
    <div class="row col-sm">
        <label for="Maximum">@T["Maximum"]</label>
        <input asp-for="Maximum" class="form-control" />@*step="@step" type="number"*@
        <span class="hint">@T["The maximum value allowed. (optional)"]</span>
    </div>
</div>

<div class="form-group">
    <div class="row col-sm">
        <label for="DefaultValue">@T["Default value"]</label>
        <input asp-for="DefaultValue" class="form-control" min="@minimum" max="@maximum" step="@stepAttribute" type="number" />
        <span class="hint">@T["The default value. (optional)"]</span>
    </div>
</div>
